package com.wipz.eoa.iphone.officesupplies;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.wipz.eoa.iphone.BaseAction;

public class MyOfficeSuppliesAction extends BaseAction {
	private static final long serialVersionUID = 1L;
	private IMyOfficeSuppliesService myofficeSuppliesService;
	private Map detail;//我的办公用品详情
	private List list;//我的办公用品列表
	
	public void setMyofficeSuppliesService(
			IMyOfficeSuppliesService myofficeSuppliesService) {
		this.myofficeSuppliesService = myofficeSuppliesService;
	}
	public IMyOfficeSuppliesService getMyofficeSuppliesService() {
		return myofficeSuppliesService;
	}
	
	public void setDetail(Map detail) {
		this.detail = detail;
	}
	public Map getDetail() {
		return detail;
	}

	public List getList() {
		return list;
	}
	public void setList(List list) {
		this.list = list;
	}
/**
 * 我的办公用品列表
 * @return
 */
	public String list(){
		Map<String, Object> hashMap = new HashMap<String,Object>();
		hashMap.put("COMMITERCODE", getRequest().getParameter("COMMITERCODE"));
		hashMap.put("BILLCODE", getRequest().getParameter("BILLCODE"));
		hashMap.put("SUPLIESTYPE",getRequest().getParameter("SUPLIESTYPE"));
		hashMap.put("SUPPLIESQUANTITY", getRequest().getParameter("SUPPLIESQUANTITY"));
		hashMap.put("APPLYDATE", getRequest().getParameter("APPLYDATE"));
		list=myofficeSuppliesService.queryList("myOfficeSupplies.querylist", hashMap);
		return SUCCESS;
	}
	/**
	 * 我的办公用品详情
	 * @return
	 */
	public String detail(){
		String id=getRequest().getParameter("id");
		if(StringUtils.isNotEmpty(id)){
			Map<String,Object> hashMap=new HashMap<String,Object>();
			hashMap.put("ID",id);
			setDetail((Map)myofficeSuppliesService.queryOne("myOfficeSupplies.queryByID", hashMap));
		}
		return SUCCESS;
	}
	
	public String delete(){
		String id=getRequest().getParameter("id");
		if(StringUtils.isNotEmpty(id)){
			myofficeSuppliesService.delete("myOfficeSupplies.delete", id);
		}
		return SUCCESS;
	}
	
	public String scrapApply(){
    
		return SUCCESS;
		
	}


}
